/*
 Navicat Premium Data Transfer

 Source Server         : zemo
 Source Server Type    : MySQL
 Source Server Version : 50617
 Source Host           : localhost
 Source Database       : demo

 Target Server Type    : MySQL
 Target Server Version : 50617
 File Encoding         : utf-8

 Date: 07/04/2014 15:36:36 PM
*/

SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
--  Table structure for `sys_attachments`
-- ----------------------------
DROP TABLE IF EXISTS `sys_attachments`;
CREATE TABLE `sys_attachments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `del_flag` int(11) DEFAULT NULL,
  `content_type` varchar(255) NOT NULL,
  `create_by` int(11) DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  `enable` tinyint(1) DEFAULT NULL,
  `file_name` varchar(255) DEFAULT NULL,
  `file_size` int(11) DEFAULT NULL,
  `file_url` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COMMENT='附件表';

-- ----------------------------
--  Table structure for `sys_user`
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `company_id` int(11) DEFAULT NULL COMMENT '归属公司',
  `office_id` int(11) DEFAULT NULL COMMENT '归属部门',
  `login_name` varchar(255) NOT NULL COMMENT '登录名',
  `password` varchar(255) NOT NULL COMMENT '密码',
  `salt` varchar(255) NOT NULL,
  `no` varchar(255) DEFAULT NULL COMMENT '工号',
  `name` varchar(255) NOT NULL,
  `gender` tinyint(4) DEFAULT NULL COMMENT '性别（0：男；1：女；2：保密）',
  `birthdate` date DEFAULT NULL COMMENT '生日',
  `card_type` int(11) DEFAULT NULL COMMENT '证件类型（1：身份证；2：军官证；3：驾驶证；4：其他）',
  `card_no` varchar(45) DEFAULT NULL COMMENT '证件号码',
  `nationality` varchar(45) DEFAULT NULL COMMENT '民族',
  `native_place` varchar(45) DEFAULT NULL COMMENT '籍贯',
  `email` varchar(255) DEFAULT NULL COMMENT '邮箱',
  `mobile` varchar(255) DEFAULT NULL COMMENT '手机',
  `phone` varchar(255) DEFAULT NULL COMMENT '电话',
  `family_address` varchar(255) DEFAULT NULL COMMENT '家庭住址',
  `contact_address` varchar(255) DEFAULT NULL COMMENT '联系地址',
  `job` varchar(45) DEFAULT NULL COMMENT '从事岗位',
  `skill_level` varchar(45) DEFAULT NULL COMMENT '技能级别',
  `user_type` varchar(255) DEFAULT NULL COMMENT '用户类型',
  `host` varchar(255) DEFAULT NULL COMMENT '最后登陆IP',
  `login_date` datetime DEFAULT NULL COMMENT '最后登陆时间',
  `picture` int(11) DEFAULT NULL COMMENT '头像图片',
  `brief` varchar(255) DEFAULT NULL COMMENT '个人简介',
  `del_flag` int(11) NOT NULL COMMENT '删除标记（0：正常；1：删除）',
  PRIMARY KEY (`id`),
  KEY `sys_user_company_id` (`company_id`) USING BTREE,
  KEY `sys_user_office_id` (`office_id`) USING BTREE,
  KEY `sys_user_login_name` (`login_name`),
  KEY `sys_user_del_flag` (`del_flag`),
  KEY `FK_b9bngbew7788y87fndhgadegj` (`company_id`),
  KEY `FK_lbf1d33uaefdj5u00700981d3` (`office_id`),
  KEY `FK_8ob2t03joey3rk807yk7lf62r` (`card_type`),
  KEY `FK_nihaozheshisuijishengchd3` (`picture`),
  CONSTRAINT `FK_nihaozheshisuijishengchd3` FOREIGN KEY (`picture`) REFERENCES `sys_attachments` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8 COMMENT='用户表';

-- ----------------------------
--  Records of `sys_user`
-- ----------------------------
BEGIN;
INSERT INTO `sys_user` VALUES ('22', null, null, 'zemo', 'ff2b305dd601660da47f95c3a703dadac8028658', '515baada7a64cffe', null, 'zemo', null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, '0');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
